PgLayout.getCaretPos

Given an index within a layout, determines the positions that of the strong and weak cursors if the insertion point is at that index.

This is a variant of [method@Pango.Layout.get_cursor_pos] that applies font metric information about caret slope and offset to the positions it returns.

<picture> <source srcset="caret-metrics-dark.png" media="(prefers-color-scheme: dark)"> <img alt="Caret metrics" src="caret-metrics-light.png"> </picture>

class PgLayout
void
getCaretPos

Parameters

index int

the byte index of the cursor

strongPos PangoRectangle

location to store the strong cursor position

weakPos PangoRectangle

location to store the weak cursor position

Meta

Since

1.50